package com.webapp.service.impl;

import com.webapp.model.PrdRecommProductDetail;
import com.webapp.mapper.PrdRecommProductDetailMapper;
import com.webapp.service.PrdRecommProductDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liuxiangpeng
 * @since 2021-10-25
 */
@Service
public class PrdRecommProductDetailServiceImpl extends ServiceImpl<PrdRecommProductDetailMapper, PrdRecommProductDetail> implements PrdRecommProductDetailService {

    @Autowired
    PrdRecommProductDetailMapper prdRecommProductDetailMapper;


    @Override
    public ArrayList<Long> getxinkeList() {
        ArrayList<Long> list1 = new ArrayList<>();

        ArrayList<Long> list = prdRecommProductDetailMapper.getxinkeList();//1个一年期

        ArrayList<Long> getchangxiang = prdRecommProductDetailMapper.getchangxiang();//长险，长险
        if (list!=null&&list.size()!=0){
            list1.add(list.get(0));
        }
        if (getchangxiang!=null&&getchangxiang.size()>1){
            list1.add(getchangxiang.get(0));list1.add(getchangxiang.get(1));
        }
        return list1;

    }

    @Override
    public ArrayList<Long> getdoudi(String gongsi, String qudao) {
        return prdRecommProductDetailMapper.getdoudiList(gongsi,qudao);

    }

    @Override
    public ArrayList<Long> tanxingmoban(String gongsi, String qudao, ArrayList<String> statuss1,Integer number) {
        return prdRecommProductDetailMapper.tanxingmoban(gongsi,qudao,statuss1,number);
    }


}
